package pattern.singleton.懒汉式;

/**
 * 双重检查
 */
public class doubleCheck {
    private doubleCheck(){}

    private static volatile doubleCheck instance;
    public static doubleCheck getInstance(){
        if (instance == null){
            synchronized (doubleCheck.class){
                if (instance == null){
                    instance = new doubleCheck();
                }
            }
        }
        return instance;
    }
    

}
